﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using KZ.Exception;
using KZ.Lottery.Resources;

namespace KZ.Lottery.DAL
{
    public class ValueDAL
    {
        public static DataTable GetValueList(DateTime? date)
        {
            try
            {
                DataTable dt = new DataTable();

                DataAccessHelper.SqlCmd.Parameters.Add("Date", SqlDbType.DateTime).Value = date;
                IDataReader reader = DataAccessHelper.ExecuteQuery(CommandType.StoredProcedure, KZ_StoreName.ValueGetList);
                dt.Load(reader);
                
                return dt;
            }
            catch (SqlException ex)
            {
                Log.LogEx("GetValueList", ex);
                throw new DataAccessException(KZ_Message.BLM_ERR_VALUE_GET);
            }
        }
    }
}
